package pro.shushi.pamirs.demo.api.enumeration;

import pro.shushi.pamirs.meta.annotation.Errors;
import pro.shushi.pamirs.meta.annotation.sys.Base;
import pro.shushi.pamirs.meta.common.enmu.ExpBaseEnum;
import pro.shushi.pamirs.meta.common.enmu.IEnum;

/**
 * Demo模块错误枚举
 */
@Base
@Errors(displayName = "Demo模块错误枚举")
public enum DemoExpEnumerate implements ExpBaseEnum, IEnum<Integer> {



    DEMO_ITEM_ID_ISNULL(ERROR_TYPE.BIZ_ERROR, 1000001, "商品ID不能为空"),
    PRODUCT_STOCK_TOTAL_ISNULL(ERROR_TYPE.BIZ_ERROR, 1000001, "库存的总库存数不能为空"),
    PRODUCT_STOCK_PRICE_ISNULL(ERROR_TYPE.BIZ_ERROR, 1000001, "库存的价格不能为空"),
    PRODUCT_PRICE_PRICE_ISNULL(ERROR_TYPE.BIZ_ERROR, 1000001, "价格的公布价和结算价都不能为空"),


    SYSTEM_ERROR(ERROR_TYPE.SYSTEM_ERROR, 1000000, "系统异常");

    public static final String DICTIONARY = "error.core.DemoCore.exceptions";

    private final ERROR_TYPE type;
    private final int code;
    private final String msg;

    DemoExpEnumerate(ERROR_TYPE type, int code, String msg) {
        this.type = type;
        this.code = code;
        this.msg = msg;
    }

    @Override
    public ERROR_TYPE type() {
        return type;
    }

    @Override
    public int code() {
        return code;
    }

    @Override
    public String msg() {
        return msg;
    }
}
